from django.core.management.base import BaseCommand

from gis.common import track_logging
from itpay.core.agency import agency_sort_service

_LOGGER = track_logging.getLogger(__name__)


class Command(BaseCommand):
    def handle(self, *args, **options):
        _LOGGER.info("begin init agency weekly sort score")
        try:
            agency_sort_service.init_agency_weekly_score()
        except:
            _LOGGER.exception("fail init agency weekly sort score")
        _LOGGER.info("done init agency weekly sort score")
